﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DDD.Core;

using FloatComparer = DDDTest.Helper.FloatComparer;

using Vector2 = DDD.Core.Vector2<float>;
using Vector3 = DDD.Core.Vector3<float>;


namespace DDDTest.Core {
    [TestClass]
    public class TestPointSpriteMode {
        [TestMethod]
        public void Test_New1 () {
            var psmode = new PointSpriteMode ();


            Assert.AreEqual (new Vector3 (1, 0, 0), psmode.Attenuation);
            Assert.AreEqual (1, psmode.ConstantAttenuation);
            Assert.AreEqual (0, psmode.LinearAttenuation);
            Assert.AreEqual (0, psmode.QuadraticAttenuation);
            Assert.AreEqual (new Vector2 (0, 0), psmode.ClampSize);
            Assert.AreEqual (0, psmode.ClampMin);
            Assert.AreEqual (0, psmode.ClampMax);
        }

        public void Test_SetAttenuation () {
            var psmode = new PointSpriteMode ();
            psmode.SetAttenuation (1, 2, 3);

            Assert.AreEqual (new Vector3 (1, 2, 3), psmode.Attenuation);
            Assert.AreEqual (1, psmode.ConstantAttenuation);
            Assert.AreEqual (2, psmode.LinearAttenuation);
            Assert.AreEqual (3, psmode.QuadraticAttenuation);
        }

        public void Test_SetClampSize () {
            var psmode = new PointSpriteMode ();
            psmode.SetClampSize (1, 2);

            Assert.AreEqual (new Vector2 (1, 2), psmode.ClampSize);
            Assert.AreEqual (1, psmode.ClampMin);
            Assert.AreEqual (2, psmode.ClampMax);
        }

        public void Test_SetAlphaThreshold () {
            var psmode = new PointSpriteMode ();
            psmode.SetAlphaThreshold (2);

            Assert.AreEqual (2, psmode.AlphaThreshold);
        }
    }
}
